package com.sikaryofficial.backend.domain.dto.resp.points;

import com.sikaryofficial.backend.domain.entity.PointsRule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * @author : qinjinyuan
 * @desc : 用户积分任务详情
 * @date : 2023/10/31 17:28
 */
@ApiModel(description = ": 用户积分任务详情")
@Setter
@Getter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserPointsTaskDTO extends PointsRuleDTO{

	/**
	 * 积分获取名称
	 */
	@ApiModelProperty("积分获取名称")
	private String ruleTaskName;

	/**
	 * 任务是否还能触发，0-不能，1-能
	 */
	@ApiModelProperty("任务是否还能触发，0-不能，1-能")
	private Boolean enable;

	/**
	 * 当日剩余次数
	 */
	@ApiModelProperty("当日剩余次数, -1:表示无限次数, 0:表示次数用尽, >0:表示当天可用次数")
	private Integer remainderTimesPerDay;

	public UserPointsTaskDTO(PointsRule pointsRule) {
		setPointsRuleId(pointsRule.getPointsRuleId());
		setPointsValue(pointsRule.getPointsValue());
		setMaxPointsValue(pointsRule.getMaxPointsValue());
		setTimesPerDay(pointsRule.getTimesPerDay());
		setRuleCode(pointsRule.getRuleCode());
		setRuleName(pointsRule.getRuleName());
		setOperate(pointsRule.getOperate());
		setRuleCategory(pointsRule.getRuleCategory());
		setRuleCategoryDesc(pointsRule.getRuleCategoryDesc());
	}
	
}
